const Mock = require('mockjs')


const equipList = []

for (let i = 0; i < 20; i++) {
  equipList.push(Mock.mock({
    id: '@increment',
    area_code: (340102001000+i+1).toString(),
    area_name:'安徽省/合肥市/蜀山区/梦圆小区/'+i+1+'栋',
    area_path:["340000","340100","340104","340104001","340104001001"],
    device_class:1,
    device_version:1,
    device_name:"@last",
    device_number:'34010200100000123',
    device_size:'12',
    terminal_number:'15056928426',
    install_address:'15056928426',
    status:1,
    customer:{
      area_code: (340102001000+i+1).toString(),
      area_name:'安徽省/合肥市/蜀山区/梦圆小区/'+i+1+'栋',
      area_path:["340000","340100","340104","340104001","340104001001"],
      customer_name:'@first',
      customer_type:'居民',
      room_number:"801",
      identity_card:'34010200100000123',
      identity_type:'身份证',
      mobile:'15056928426',
      establish_time:+Mock.Random.date('T')
    },
    start_time:Mock.Random.date('T'),
    start_amount:+Mock.Random.date('T'),
    total_amount:+Mock.Random.date('T')
  }))
}

module.exports = [
  {
    url: '/device/list',
    type: 'get',
    response: config => {
      return {
        code: 20000,
        data: {
          list:equipList,
          total:equipList.length
        }
      }
    }
  },
  {
    url: '/device/delete',
    type: 'post',
    response: config => {
      return {
        code: 20000,
        data: ''
      }
    }
  },
  {
    url: '/device/add',
    type: 'post',
    response: config => {
      return {
        code: 20000,
        data: ''
      }
    }
  },
  {
    url: '/device/update',
    type: 'post',
    response: config => {
      return {
        code: 20000,
        data: ''
      }
    }
  }
]

